//
//  HNSH_ConfirmOrderGoodsHeader.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/2/26.
//

#import "HNSH_ConfirmOrderGoodsHeader.h"

@interface HNSH_ConfirmOrderGoodsHeader ()

/* bgView */
@property (nonatomic, strong) UIView *bgView;
/* nameLabel */
@property (nonatomic, strong) UILabel *nameLabel;

@end

@implementation HNSH_ConfirmOrderGoodsHeader

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = [UIColor appBGColor];
        [self configUI];
    }
    return self;
}

- (void)setTitleString:(NSString *)titleString {
    _titleString = titleString;
    self.nameLabel.text = titleString;
}

- (void)configUI {
    [self.contentView addSubview:self.bgView];
    [self.bgView addSubview:self.nameLabel];
    
    [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(0);
        make.top.mas_equalTo(8);
    }];
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(16);
        make.left.mas_equalTo(20);
        make.height.mas_equalTo(20);
    }];
}

#pragma mark lazy
- (UIView *)bgView {
    if (!_bgView) {
        _bgView = [[UIView alloc]init];
        _bgView.backgroundColor = [UIColor appWhiteLabelColor];
    }
    return _bgView;
}

- (UILabel *)nameLabel {
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.text = @"哆啦商城";
        _nameLabel.textColor = [UIColor appGrayLabelColor];
        _nameLabel.font = [UIFont systemFontOfSize:14];
    }
    return _nameLabel;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
